home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_sol_ramp.cog < prev    next >
Text File  |  1999-11-15  |  9KB  |  345 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SOL_Ramp.cog
  4. #
  5. # Like, Boom!
  6. #
  7. # [TRM]
  8. #
  9. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14.     message     startup
  15.     message     user0
  16.     message     entered
  17.     message     arrived
  18.     message     timer
  19.     
  20.     thing       car     local
  21.     
  22.     # Destroy these
  23.     thing       trackA0
  24.     thing       trackA1
  25.     thing       trackA2
  26.     thing       trackA3
  27.     
  28.     # Create these
  29.     thing       trackB1
  30.     thing       trackB2
  31.     thing       trackB3
  32.     thing       trackB4
  33.     thing       trackB5
  34.     
  35.     thing       explosion1
  36.     thing       explosion2
  37.     thing       explosion3
  38.     thing       pillar
  39.     thing       blueLight
  40.     
  41.     thing       rock1
  42.     thing       rock2
  43.     thing       rock3
  44.     thing       rock4
  45.     
  46.     surface     waterSurf
  47.     
  48.     surface     rampTop0
  49.     surface     rampTop1    
  50.     surface     rampTop2
  51.     
  52.     surface     rampSide0
  53.     surface     rampSide1
  54.     surface     rampSide2
  55.     surface     rampSide3
  56.     surface     rampSide4
  57.     surface     rampSide5
  58.     surface     rampSide6
  59.     surface     rampSide7
  60.     surface     rampSide8
  61.     
  62.     surface     air0
  63.     surface     air1
  64.     surface     air2
  65.     surface     air3
  66.     surface     air4
  67.     
  68.     surface     hole0
  69.     surface     hole1
  70.     surface     hole2
  71.     surface     hole3
  72.     surface     hole4
  73.     
  74.     surface     burnt0
  75.     surface     burnt1
  76.     surface     burnt2
  77.     surface     burnt3
  78.     surface     burnt4
  79.     surface     burnt5
  80.     surface     burnt6
  81.     surface     burnt7
  82.     surface     burnt8
  83.     surface     burnt9
  84.     surface     burnt10
  85.     surface     burnt11
  86.     surface     burnt12
  87.     surface     burnt13
  88.     
  89.     # jump face triggers
  90.     surface     jumpOn
  91.     surface     jumpOff
  92.     surface     trig_BlownUp
  93.     
  94.     template    tplTrack1=1m_tracks         local
  95.     template    tplTrack2=hlfm_tracks       local
  96.     template    tplTrack3=1hlfm_tracks      local
  97.     template    tplTrack4=bentTrack         local
  98.     template    tplRock1=stnshrpa           local
  99.     template    tplRock2=stnshrpb           local
  100.     #template    tplExp=+gen_exp_stone_nc    local
  101.     template    tplExp=+bazooka_exp         local
  102.     
  103.     material    mat1=lag_wall_cave.mat                  local
  104.     material    mat2=gen_a4_water_stillc.mat            local
  105.     material    mat3=sol_floor_mural_plain_burn.mat     local
  106.     
  107.     sound        sndExpload=gen_grenade_explode.wav        local
  108.     
  109.     cog         speedO
  110.     
  111.     vector      color           local
  112.     
  113.     int         done=0          local
  114.     int         tim=0           local
  115.     
  116.     int         top=0           local
  117.     int         side=0          local
  118.     int         air=0           local
  119.     int         hole=0          local
  120.     int         ta=0            local
  121.     int         tb=0            local
  122.     int         burnt=0         local
  123.     int         blownUp=0       local
  124.     int         firstTime=0     local
  125.     int         ready=0         local
  126.                                 
  127.     int         numTA=4         local
  128.     int         numTB=4         local
  129.     int         numTops=3       local
  130.     int         numSides=9      local
  131.     int         numAir=5        local
  132.     int         numHole=5       local
  133.     int         numBurnt=14     local
  134.     
  135. end
  136.  
  137. # ========================================================================================
  138.  
  139. code
  140.  
  141. startup:
  142.  
  143.     # Turn off the ramp faces
  144.     for (top=0; top<numTops; top=top+1)
  145.     {
  146.         SetFaceGeoMode(rampTop0[top], 0);
  147.         #SetAdjoinFlags(rampTop0[top], 2);     # move
  148.     }
  149.         
  150.     for (side=0; side<numSides; side=side+1)
  151.     {
  152.         SetFaceGeoMode(rampSide0[side], 0);
  153.     }
  154.     
  155.     # Don't render past hole
  156.     for (hole=0; hole<numHole; hole=hole+1)
  157.     {
  158.         ClearAdjoinFlags(hole0[hole], 1);     # no see
  159.     }
  160.     
  161.     # put opaque texture on waterSurf
  162.     SetSurfaceMat(waterSurf, mat1);
  163.                     
  164.     return;
  165.  
  166. # ========================================================================================
  167.  
  168. user0:
  169.             
  170.     #Print("ramp: message received");
  171.     # BANG!!!
  172.     CreateThing(tplExp, explosion1);
  173.     #CreateThing(tplExp, explosion2);
  174.     CreateThing(tplExp, explosion3);
  175.     
  176.     SetTimer(0.55);
  177.     
  178.     # Turn on ramp faces
  179.     for (top=0; top<numTops; top=top+1)
  180.     {
  181.         SetFaceGeoMode(rampTop0[top], 4);           # draw
  182.         ClearAdjoinFlags(rampTop0[top], 2);         # no move
  183.     }
  184.         
  185.     for (side=0; side<numSides; side=side+1)
  186.     {
  187.         SetFaceGeoMode(rampSide0[side], 4);
  188.         ClearAdjoinFlags(rampSide0[side], 2);
  189.     }
  190.         
  191.     # Turn off hole
  192.     for (hole=0; hole<numHole; hole=hole+1)
  193.     {
  194.         SetFaceGeoMode(hole0[hole], 0);     # no draw
  195.         SetAdjoinFlags(hole0[hole], 2);     # move
  196.         SetAdjoinFlags(hole0[hole], 1);     # see
  197.     }
  198.         
  199.     # Burn the clean faces
  200.     for (burnt=0; burnt<numBurnt; burnt=burnt+1)
  201.     {
  202.         SetSurfaceMat(burnt0[burnt], mat3);
  203.     }
  204.         
  205.     # Make air no move
  206.     for (air=0; air<numAir; air=air+1)
  207.     {
  208.         ClearAdjoinFlags(air0[air], 2);
  209.         SetSurfaceFlags(air0[air], 0x4000);  # Mine car track
  210.     }
  211.         
  212.     # Destroy trackA
  213.     for (ta=0; ta<numTA; ta=ta+1)
  214.     {
  215.         DestroyThing(trackA0[ta]);
  216.     }
  217.         
  218.     # Create trackB
  219.     CreateThing(tplTrack1, trackB1);
  220.     CreateThing(tplTrack2, trackB2);
  221.     CreateThing(tplTrack3, trackB3);
  222.     CreateThing(tplTrack4, trackB4);
  223.     CreateThing(tplTrack4, trackB5);
  224.     
  225.     # scatter some debris around
  226.     #CreateThing(tplRock1, rock1);
  227.     #CreateThing(tplRock1, rock2);
  228.     #CreateThing(tplRock1, rock3);
  229.     #CreateThing(tplRock2, rock4);
  230.     
  231.     # do some pillar stuff
  232.     SetCollideType(pillar, 0);
  233.     Rotate(pillar, -30, 2, 0.3);
  234.     
  235.     # change bottom water face and make it move
  236.     SetSurfaceMat(waterSurf, mat2);
  237.     SetAdjoinFlags(waterSurf, 2);     # move
  238.     
  239.     # add some blue light around open hole
  240.     color = VectorSet(1.0, 0.1, 0.1);
  241.     SetThingLight(blueLight, color, 20.0, 0.1);
  242.     
  243.     # turn on speedO cog
  244.     SendMessage(speedO, user0);
  245.     
  246.     ready = 1;
  247.     
  248.     return;   
  249.     
  250. # ========================================================================================
  251.  
  252. entered:
  253.  
  254.     car = GetSourceRef();
  255.  
  256.     if(BitTest(GetPhysicsFlags(car), 0x01000000))
  257.     {
  258.         if((blownUp == 0) && (ready == 1))
  259.         {
  260.             if(GetSenderRef() == trig_BlownUp)
  261.             {
  262.                 #Print("blownUp = 1");
  263.                 blownUp = 1;
  264.                 
  265.                 for (air=0; air<numAir; air=air+1)
  266.                 {
  267.                     #SetAdjoinFlags(air0[air], 2);           # can move thru air
  268.                     SetSurfaceFlags(air0[air], 0x4000);     # turn on track
  269.                 }
  270.                 
  271.                 ClearAdjoinFlags(air0, 2);
  272.                 ClearAdjoinFlags(air1, 2);
  273.                 SetAdjoinFlags(air2, 2);
  274.                 SetAdjoinFlags(air3, 2);
  275.                 ClearSurfaceFlags(air0, 0x40000);
  276.                 ClearSurfaceFlags(air1, 0x40000);
  277.             }
  278.         }    
  279.         
  280.         if(blownUp == 1)
  281.         {
  282.             if(GetSenderRef() == jumpOn)
  283.             {
  284.                 # Make air no move
  285.                 #Print("jump on");
  286.                 for (air=0; air<numAir; air=air+1)
  287.                 {
  288.                     ClearAdjoinFlags(air0[air], 2);         # no move air
  289.                     SetSurfaceFlags(air0[air], 0x4000);     # turn on track
  290.                 }
  291.                 
  292.                 SetSurfaceFlags(air0, 0x40000);
  293.                 SetSurfaceFlags(air1, 0x40000);
  294.             }
  295.             
  296.             else if(GetSenderRef() == jumpOff)
  297.             {
  298.                 # turn off air hole
  299.                 #Print("jump off");
  300.                 for (air=0; air<numAir; air=air+1)
  301.                 {
  302.                     #SetAdjoinFlags(air0[air], 2);           # can move thru air
  303.                     ClearSurfaceFlags(air0[air], 0x4000);   # shut off track
  304.                 }
  305.                 ClearAdjoinFlags(air0, 2);
  306.                 ClearAdjoinFlags(air1, 2);
  307.                 SetAdjoinFlags(air2, 2);
  308.                 SetAdjoinFlags(air3, 2);
  309.                 ClearSurfaceFlags(air0, 0x40000);
  310.                 ClearSurfaceFlags(air1, 0x40000);
  311.             }
  312.         }
  313.     }
  314.  
  315.     return;
  316.     
  317. # ========================================================================================
  318.  
  319. arrived:
  320.  
  321.     if(GetSenderRef() == pillar)
  322.     {
  323.         if(tim == 1) return;
  324.         #Print("arrived");
  325.         MoveToFrame(pillar, 1, 10.0);
  326.         tim = 1;
  327.         WaitForStop(pillar);
  328.         SetCollideType(pillar, 3);
  329.     }
  330.         
  331.     return;
  332.  
  333. # ========================================================================================
  334.  
  335. timer:
  336.  
  337.     color = VectorSet(0.0, 0.0, 0.0);
  338.     SetThingLight(blueLight, color, 20.0, 2.0);
  339.     return;
  340.         
  341. # ========================================================================================
  342.  
  343. end
  344.  
  345.